/**
 * 
 */
package com.aihwcm.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.aihwcm.entity.Aihtasks;
import com.aihwcm.entity.AihtasksDAO;
import com.aihwcm.entity.Aihusers;

/**
 * @author francisli
 *
 */
@Component("TaskManageService")
public class TaskManageServiceImpl implements TaskManageService {

	@Autowired(required = false)
	private AihtasksDAO aihtasksDAO;

	@Override
	public int count(Aihusers user) {
		int count = aihtasksDAO.count(user);
		return count;
	}

	@Override
	public List<Aihtasks> listpage(int offset, int limit, Aihusers user) {

		List<Aihtasks> pagelist = aihtasksDAO.listpage(offset, limit, user);

		return pagelist;
	}

	@Override
	public Aihtasks findById(Integer id) {
		Aihtasks task = aihtasksDAO.findById(id);

		return task;
	}

	@Override
	public void saveOrUpdate(Aihtasks task) {

		aihtasksDAO.saveOrUpdate(task);

	}

	@Override
	public int count(Aihusers user, String search) {
		int count = aihtasksDAO.count(user, search);
		return count;
	}

	@Override
	public List<Aihtasks> listpage(int offset, int limit, Aihusers user, String search) {

		List<Aihtasks> pagelist = aihtasksDAO.listpage(offset, limit, user, search);

		return pagelist;
	}
}
